package com.thoughtworks.bytecode2class.attribute;

import com.thoughtworks.bytecode2class.ClassReader;

public class SourceFileAttribute extends Attribute {
    private int sourceFileIndex;


    public SourceFileAttribute(ClassReader classReader, String name) {
        super(classReader, name);
    }

    protected void parseAttributeContent() {
        sourceFileIndex = classReader.forwardChar();
    }

    public String getSourceFile() {
        return classReader.getConstantPool().getUtf8Constant(sourceFileIndex).getValue();
    }
}
